package com.maxd.respository.UserCollectOrBrowse;

import com.maxd.model.Orders;
import com.maxd.model.TimedTask;
import com.maxd.model.UserCollectOrBrowse;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;


@Repository
public interface UserCollectOrBrowseRepository extends JpaRepository<UserCollectOrBrowse, Long> {

    @Query(value = "from UserCollectOrBrowse u where u.goodsId=:goodsId and u.classify=:classify and u.userId=:userId ")
    UserCollectOrBrowse selectUserCollectOrBrowse(@Param("goodsId") String goodsId,@Param("classify")  Integer classify,@Param("userId") Long userId);

    Page<UserCollectOrBrowse> findAll(Specification<UserCollectOrBrowse> specification, Pageable pageable);

}
